<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>评教</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
	<div class="container"> 
		<div id="ztc2pj" style="z-index: 999">
			<input type="button" id="pj" hidden
				class="form-control btn btn-primary btn-current" style="margin: 10;"
				value="一键评教">
			<p id="running" class="main">努力加载中 。。。</p>
			<table id="mytable">
			</table>
		</div>
	</div>
	<script>

		$('#pj').click(function(){
			var list=$('#mytable').bootstrapTable('getSelections'); 
			var cjids='';
			for(var i=0;i<list.length;i++){
				cjids+=list[i].cjid+','; 
			} 
			$.get("${pageContext.request.contextPath}/jwc/pj.ztc", {cjids : cjids});
		});

		$(function() {

			$('#lipj').addClass("active");
			$.get("${pageContext.request.contextPath}/jwc/getPjInfo.ztc", {},
					function(data) {
						var titleHeight = $('.ibox-title').height() + 20;
						$('#running').show();
						$('#pj').hide();
						$('#mytable').bootstrapTable({
							height : $(window).height() - 10,
							data : data.data,
							method : 'get',
							striped : true,
							cache : false,
							pagination : true,
							sortOrder : "asc",
							pageSize : 14,
							dataType : 'json',
							pageList : [ 10, 20, 50, 100 ],
							sidePagination : "client",
							search : true,
							rowStyle : function(row,index){ 
								if((index+1)%2==0)
									return {css:{'color' : '#3c1414'}};
								return {css:{'color' : '#3c1414','background-color':'rgb(126, 137, 148)'}};
							},
							columns : [ {
								field : "no",
								width : "5.5%",
								align : 'center',
								title : '序号',
								formatter : function(value, row, index) {
									return index + 1;
								}
							}, {
								field : 'cjid',
								align : 'center',
								title : ' 课程id ',
							}, {
								field : 'xq',
								align : 'center',
								title : ' 学期  '
							}, {
								field : 'kcmc',
								align : 'center',
								title : ' 课程名称 '
							}, {
								field : 'kcsx',
								align : 'center',
								title : ' 课程类型  '
							}, {
								field : 'ksfs',
								align : 'center',
								title : ' 考试方式  '
							}, {
								field : 'ksxz',
								align : 'center',
								title : ' 课程性质  '
							}, {
								field : 'jsxm',
								align : 'center',
								title : ' 教师名称 ',
							}, {
								field : 'status',
								align : 'center',
								title : ' 状态 ',
								formatter : function(value, row, index) {
									if (row.cpjg == '')
										return '未评教';
									return '已评教';
								}
							}, {
								field : "checked",
								checkbox : true, 
								formatter : function(value, row, index) {
									if (!row.cpjg == '')
										return {
											disabled : true
										};
								}
							} ]
						});
						$('#running').hide();
						$('#pj').show();
					});
		});
	</script>

</body>

</html>